<template>
	<view>
		<image v-if="isUser && isMan" src="../../static/people1.png" mode="widthFix"
			:style="{width: avatarWidth+'rpx',height: avatarHeight+'rpx'}"></image>
		<image v-if="isUser && !isMan" src="../../static/people2.png" mode="widthFix"
			:style="{width: avatarWidth+'rpx',height: avatarHeight+'rpx'}"></image>
		<image v-if="!isUser && isMan" src="../../static/student1.png" mode="widthFix"
			:style="{width: avatarWidth+'rpx',height: avatarHeight+'rpx'}"></image>
		<image v-if="!isUser && !isMan" src="../../static/student2.png" mode="widthFix"
			:style="{width: avatarWidth+'rpx',height: avatarHeight+'rpx'}"></image>
	</view>
</template>
<script>
	export default {
		props: {
			avatarWidth: {
				default: '100',
				type: String
			},
			avatarHeight: {
				default: '100',
				type: String
			},
			isUser: {
				default: true,
				type: Boolean
			}
		},
		data() {
			return {
				isMan: false
			}
		},
		created() {
			if (!this.isUser) {
				this.isMan = uni.getStorageSync('sex') === '男'
			} else {
				let userInfo = uni.getStorageSync('userInfo')
				if (userInfo) {
					this.isMan = userInfo && userInfo.value.personSex === 1
				} else {
					this.isMan = true
				}
				
			}
		}
	}
</script>
<style lang="less" scoped>
</style>